load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "rpcserver",
    srcs = ["server.go"],
    importpath = "go.f110.dev/heimdallr/pkg/rpc/rpcserver",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/auth",
        "//pkg/cert",
        "//pkg/config/configv2",
        "//pkg/database",
        "//pkg/logger",
        "//pkg/rpc",
        "//pkg/rpc/rpcservice",
        "//vendor/github.com/grpc-ecosystem/go-grpc-middleware",
        "//vendor/github.com/grpc-ecosystem/go-grpc-middleware/logging/zap",
        "//vendor/github.com/grpc-ecosystem/go-grpc-prometheus",
        "//vendor/github.com/prometheus/client_golang/prometheus",
        "//vendor/github.com/prometheus/client_golang/prometheus/promhttp",
        "//vendor/go.uber.org/zap",
        "//vendor/golang.org/x/xerrors",
        "//vendor/google.golang.org/grpc",
        "//vendor/google.golang.org/grpc/health/grpc_health_v1",
    ],
)

go_test(
    name = "rpcserver_test",
    srcs = ["server_test.go"],
    embed = [":rpcserver"],
    deps = [
        "//pkg/auth",
        "//pkg/cert",
        "//pkg/config/configv2",
        "//pkg/database",
        "//pkg/database/memory",
        "//pkg/logger",
        "//pkg/netutil",
        "//pkg/rpc",
        "//vendor/github.com/stretchr/testify/assert",
        "//vendor/github.com/stretchr/testify/require",
        "//vendor/google.golang.org/grpc",
        "//vendor/google.golang.org/grpc/credentials",
        "//vendor/google.golang.org/grpc/health/grpc_health_v1",
        "//vendor/google.golang.org/grpc/metadata",
    ],
)
